﻿using System.Activities;
using System.Threading;

namespace HelloWorkflow
{
    public class SayHelloInCode : CodeActivity
    {
        protected override void Execute(CodeActivityContext context)
        {
            context.SetValue(Greetings, string.Format("Hello {0} from Workflow 4", UserName.Get(context)));
            context.SetValue(ActivityThread, Thread.CurrentThread.ManagedThreadId);
        }

        public InArgument<string> UserName
        {
            get;
            set;
        }

        public OutArgument<string> Greetings
        {
            get;
            set;
        }

        public OutArgument<int> ActivityThread
        {
            get;
            set;
        }
    }
}